MkFootNotes
:fa-brands-github: Show source on GitHub
Node containing a list of MkFootNotes.¶
Bases: MkContainer
__init__
¶
__init__(
footnotes: Mapping[int, str | MkNode] | list[MkFootNote] | list[str] | None = None,
**kwargs: Any
) -> None
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
footnotes
|
Mapping[int, str | MkNode] | list[MkFootNote] | list[str] | None
|
Footnotes data (Can be given in different shapes) |
None
|
kwargs
|
Any
|
Keyword arguments passed to parent |
{}
|
| Name | Children | Inherits |
|---|---|---|
| MkContainer mknodes.basenodes.mkcontainer A node containing other MkNodes. |
graph TD
3964180375["mkfootnotes.MkFootNotes"]
835538629["mkcontainer.MkContainer"]
1956333208["mkcontainer.MkContainerBase"]
1359323199["mknode.MkNode"]
2751680898["builtins.object"]
835538629 --> 3964180375
1956333208 --> 835538629
1359323199 --> 1956333208
2751680898 --> 1359323199
/home/runner/work/mknodes/mknodes/src/mknodes/basenodes/mkfootnotes/metadata.toml
[metadata]
icon = "octicon:list-ordered-16"
name = "MkFootNotes"
[requirements.extension.footnotes]
[examples.regular]
title = "Regular"
python = """
node = MkFootNotes()
page += "The MkFootNotes node aggregates footnotes[^1]."
node[1] = r"Footnotes are numbered, can be set via `__setitem__`."
node[2] = r"They can also get nested[^3]."
node[3] = mk.MkAdmonition("And they can also contain other Markdown.")
node
"""
[fragments.footnote]
template = """
[^{{ footnote.num }}]
{{ node.get_items() | join("\n") | indent(first=True) }}
"""
[output.markdown]
template = """
{{ node.get_items() | sort(attribute="num") | join }}
"""
[output.rst]
template = """
.. rubric:: Footnotes
{% for item in node.get_items() | sort(attribute="num") %}
.. {{ item }}
"""
| mknodes.basenodes.mkfootnotes.MkFootNotes | |
|---|---|
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |